//Francisco "Kiko" Olvera
//An intermediate class between the game and directx
//can be modified in the future with a #define to swtich between directx and opengl
#pragma once
#include "DX include.h"
#include "Material.h"
class Material;

class Mesh
{
private:
	ID3DXMesh* instance;
	LPDIRECT3DDEVICE9 device;
	D3DXMATRIX meshMat, meshScale, meshRotate, meshTranslate;
	ID3DXBuffer* AdjBuffer, *XMaterials, *XEffects;
	DWORD numMaterials;
	D3DMATERIAL9* meshMaterials;
	LPDIRECT3DTEXTURE9*	meshTextures;
	int currentTexture, maxTextures;

public:
	//constructor
	Mesh();
	Mesh(char*);
	//Will added a destructor
	~Mesh();
	//functions
	void Load(char*);
	void Load(char*, int);
	void LoadNextTexture(char*);
	void LoadTexture(int, char*);
	void Draw();
	void Draw(float, float);
	void Draw(float, float, int);
	void Draw(int, float, float);

	//access the material
	//Material* getMaterial(){ return material; }
};